package grafico;

import java.awt.BorderLayout;
import java.awt.Container;
import java.awt.Dimension;

import javax.swing.Box;
import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.WindowConstants;

public class DlgConfigGeral extends JDialog 
{
	static final long serialVersionUID = 1;

	public DlgConfigGeral()
	{
		this.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
		this.setSize(new Dimension(600,300));
	
		Container principal = this.getContentPane();
		principal.setLayout(new BoxLayout(principal, BoxLayout.Y_AXIS));
		principal.setBackground(Fabrica.background);
		
		JPanel painel_superior = Fabrica.painelFundoAzul();
		painel_superior.setPreferredSize(new java.awt.Dimension(400, 70));
		principal.add(painel_superior);
		painel_superior.setOpaque(false);
		
		JLabel titulo_janela = new JLabel("Configurações Gerais");
		titulo_janela.setForeground(Fabrica.branco);
		titulo_janela.setFont(Fabrica.fonteGrande);
		painel_superior.add(titulo_janela);
		
		JPanel controle1 = Fabrica.painelFundoAzul();
		controle1.setLayout(new BoxLayout(controle1,BoxLayout.X_AXIS));
		JPanel pnNotasRodape = Fabrica.painelFundoAzul();
		pnNotasRodape.setLayout(new BoxLayout(pnNotasRodape, BoxLayout.Y_AXIS));
		JCheckBox ckNotasRodape = new JCheckBox("Exibir notas de rodapé");
		ckNotasRodape.setBackground(Fabrica.background);
		ckNotasRodape.setFont(Fabrica.fonteMedia);
		ckNotasRodape.setForeground(Fabrica.branco);
		ckNotasRodape.setSelected(true);
        pnNotasRodape.add(ckNotasRodape);
        controle1.add(Box.createRigidArea(new Dimension(10,0)));
		controle1.add(pnNotasRodape);
		JPanel pnNumsPagina = Fabrica.painelFundoAzul();
		pnNumsPagina.setLayout(new BoxLayout(pnNumsPagina, BoxLayout.Y_AXIS));
		JCheckBox ckNumsPagina = new JCheckBox("Exibir números de página");
		ckNumsPagina.setBackground(Fabrica.background);
		ckNumsPagina.setFont(Fabrica.fonteMedia);
		ckNumsPagina.setForeground(Fabrica.branco);
		ckNumsPagina.setSelected(true);
        pnNumsPagina.add(ckNumsPagina);
        controle1.add(Box.createRigidArea(new Dimension(10,0)));
		controle1.add(pnNumsPagina);
		controle1.add(Box.createRigidArea(new Dimension(10,0)));
		controle1.setPreferredSize(new Dimension(60,70));
		controle1.setMaximumSize(new Dimension(600,70));
		principal.add(controle1);
		
		JPanel controle2 = Fabrica.painelFundoAzul();
		controle2.setLayout(new BoxLayout(controle2,BoxLayout.X_AXIS));
		JPanel pnNavAutomatica = Fabrica.painelFundoAzul();
		pnNavAutomatica.setLayout(new BoxLayout(pnNavAutomatica, BoxLayout.Y_AXIS));
		JCheckBox ckNavegacao = new JCheckBox("Navegação Automática");
		ckNavegacao.setBackground(Fabrica.background);
		ckNavegacao.setFont(Fabrica.fonteMedia);
		ckNavegacao.setForeground(Fabrica.branco);
        ckNavegacao.setSelected(true);
        pnNavAutomatica.add(ckNavegacao);
        controle2.add(Box.createRigidArea(new Dimension(10,0)));
		controle2.add(pnNavAutomatica);
		JPanel pnFonte = Fabrica.painelFundoAzul();
		pnFonte.setLayout(new BoxLayout(pnFonte, BoxLayout.Y_AXIS));
		JLabel lbFonte = Fabrica.labelBranco("Tamanho da fonte");
		pnFonte.add(lbFonte,BoxLayout.X_AXIS);
		String[] fontes  = { "100%", "125%", "150%", "175%", "200%" };
		JComboBox cbFonte = new JComboBox(fontes);
		cbFonte.setMaximumSize(new Dimension(120,30));
		cbFonte.setPreferredSize(new Dimension(120,30));
		pnFonte.add(cbFonte);
		controle2.add(Box.createRigidArea(new Dimension(10,0)));
		controle2.add(pnFonte);
		controle2.add(Box.createRigidArea(new Dimension(10,0)));
		controle2.setPreferredSize(new Dimension(600,70));
		controle2.setMaximumSize(new Dimension(600,70));
		principal.add(controle2);
		
		JPanel controle3 = Fabrica.painelFundoAzul();
		controle3.setLayout(new BoxLayout(controle3, BoxLayout.Y_AXIS));
		JPanel pnLbEscolher = Fabrica.painelFundoAzul();
		JLabel lbEscolher = Fabrica.labelBranco("Diretório de Textos");
		pnLbEscolher.add(lbEscolher);
		JPanel pnTxEscolher = Fabrica.painelFundoAzul();
		pnTxEscolher.setLayout(new BoxLayout(pnTxEscolher, BoxLayout.X_AXIS));
		JTextField txLocal = new JTextField();
		txLocal.setFont(Fabrica.fonteMedia);
		txLocal.setPreferredSize(new Dimension(100, 30));
		txLocal.setMaximumSize(new Dimension(200, 30));
		pnTxEscolher.add(txLocal);
		JButton btLocal = new JButton("Escolher");
		pnTxEscolher.add(btLocal);
		controle3.add(pnLbEscolher);
		controle3.add(pnTxEscolher);		
		principal.add(controle3);
		
		JPanel painel_inferior = Fabrica.painelFundoAzul();
		painel_inferior.setPreferredSize(new java.awt.Dimension(400, 50));
		painel_inferior.setLayout(new BoxLayout(painel_inferior,BoxLayout.X_AXIS));
		principal.add(painel_inferior, BorderLayout.SOUTH);
		
		JButton fechar = Fabrica.botaoComImagem("fechar", "Fechar");
		painel_inferior.add(fechar);
		this.setResizable(false);
		this.setModal(true);
	}
}
